package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import bean.UserType;

public class LogoutAction extends Action {
	
	public LogoutAction() { }

	@Override
	public String getName() { return "logout.do"; }

	@Override
	public String perform(HttpServletRequest request) {
        HttpSession session = request.getSession(false);
        session.setAttribute("user",null);
        session.invalidate();
        return "login.jsp";
    }

	@Override
	public UserType getType() {
		return UserType.Both;
	}

}
